$(function () {
  var cApi = new common();
  //var hostUrl = 'http://121.204.136.234:48000/'
  var hostUrl = 'http://117.29.162.206:8089/'

  var billId = cApi.getQueryString('billId');

 




  ProcessDetails();
  //获取流程数据
  function ProcessDetails() {
    var dataweijiami = "{data: {billId: "+billId+",billKey:'OA_Notice'}}"; //接口传递的参数
    url = hostUrl + "Yigo1.6/services/MapWebService?wsdl"; //请求地址
    var fanhuidata = SoapRequest("LoginWebService", "noticedtl", dataweijiami, url); //调用请求
     //解密后转成json格式
	$('#content').text(fanhuidata.noticeContent);
    
  


  }


 // 请求函数
  function SoapRequest(interface, method, parameter) {
    var data;
    //SOAP 1.1 请求报文格式，1.2在网上可以找到
    data = '<?xml version="1.0" encoding="utf-8"?>';
    data += '<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns0="http://webservice.mid.myerp.bokesoft.com" xmlns:q0="http://schemas.xmlsoap.org/soap/encoding/" xmlns:something="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">';
    data += '<soapenv:Body>';
    data += '<ns0:unsafeInvokeService>';
    data += '<sServiceName soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="xsd:string">'+interface+'</sServiceName>';
    data += '<args q0:arrayType="xsd:anyType[2]" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="q0:Array">';
    data += '<q0:string>'+method+'</q0:string>';
    data += '<q0:string>'+parameter+'</q0:string>';
    data += '</args>';
    data += '</ns0:unsafeInvokeService>';
    data += '</soapenv:Body>';
    data += '</soapenv:Envelope>';

    var xmlhttp = CreateXMLHttp();
	   
    var URL = url;
    xmlhttp.open("POST", URL, false);
    xmlhttp.setRequestHeader("Content-Type", "application/soap+xml; charset=utf-8"); //SOAP 1.1为text/xml ； 1.2为 application/soap+xml
    xmlhttp.setRequestHeader("SOAPAction", "wsdl");
 
    xmlhttp.send(data);




    var dd = xmlhttp.responseXML.getElementsByTagName("unsafeInvokeServiceReturn");
	  //var dd=XMLtoString(xmlhttp.responseXML.getElementsByTagName("unsafeInvokeServiceReturn")[0])+"";
	  
	  
    var ee = dd[0].textContent;
	
    var ff = JSON.parse(ee);
	console.log(ff.status);
	if(ff.status==-5){
		if (type == 0) {
		  window.webkit.messageHandlers.Submission.postMessage('-5');
		} else {
		  window.android.showOfflineWarm();
		}
	
	}
    return  ff.data.billhead[0];
    

  }



 
 
 

 





})